fix fail to build on big-endian
authorAsias He <asias.hejun@gmail.com>
Mon, 16 May 2011 12:47:06 +0000 (20:47 +0800)
committerAsias He <asias.hejun@gmail.com>
Mon, 16 May 2011 12:52:05 +0000 (20:52 +0800)
Signed-off-by: Asias He <asias.hejun@gmail.com>
debian/changelog
debian/control
debian/patches/fix-big-endian-build.diff [new file with mode: 0644]
debian/patches/series [new file with mode: 0644]
debian/rules

index 44d15d91e4eac4adbee47a7351d39fca4a3bf4bc..945fbcab1b964849eec688d44f943ba3b94feacf 100644 (file)
@@ -1,3 +1,10 @@
+opencc (0.2.0-2) unstable; urgency=low
+
+  * Fix "Please fix FTBFS on mips, ppc, s390 and sparc" (Closes: #624562)
+  * debian/control: bump standards version to 3.9.2.
+
+ -- Asias He <asias.hejun@gmail.com>  Mon, 16 May 2011 20:46:03 +0800
+
 opencc (0.2.0-1) unstable; urgency=low
 
   * New upstream release
index 1218edad96e31b105c1de37fb8c417095ba6d73c..095de1fd288f67c1c28988673894915c8e4a764f 100644 (file)
@@ -2,8 +2,8 @@ Source: opencc
 Priority: optional
 Maintainer: IME Packaging Team <pkg-ime-devel@lists.alioth.debian.org> 
 Uploaders: LI Daobing <lidaobing@debian.org>, Asias He <asias.hejun@gmail.com>
-Build-Depends: debhelper (>= 7.0.50~), autotools-dev, cmake
-Standards-Version: 3.9.1
+Build-Depends: debhelper (>= 7.0.50~), autotools-dev, cmake, quilt
+Standards-Version: 3.9.2
 Section: libs
 Homepage: http://code.google.com/p/opencc
 Vcs-Git: git://git.debian.org/git/pkg-ime/opencc.git
diff --git a/debian/patches/fix-big-endian-build.diff b/debian/patches/fix-big-endian-build.diff
new file mode 100644 (file)
index 0000000..fe40028
--- /dev/null
@@ -0,0 +1,29 @@
+--- a/src/encoding.c
++++ b/src/encoding.c
+@@ -130,11 +130,7 @@
+                       pucs4 = ucs4 + freesize;
+               }
+-              #if BYTEORDER == LITTLE_ENDIAN
+-                      *pucs4 = (byte[3] << 24) + (byte[2] << 16) + (byte[1] << 8) + byte[0];
+-              #else
+-                      *pucs4 = (byte[0] << 24) + (byte[1] << 16) + (byte[2] << 8) + byte[3];
+-              #endif
++              *pucs4 = (byte[3] << 24) + (byte[2] << 16) + (byte[1] << 8) + byte[0];
+               pucs4 ++;
+               freesize --;
+@@ -174,13 +170,8 @@
+               ucs4_t c = ucs4[i];
+               ucs4_t byte[4] =
+               {
+-              #if BYTEORDER == LITTLE_ENDIAN
+                       (c >> 0) & BITMASK(8), (c >> 8) & BITMASK(8),
+                       (c >> 16) & BITMASK(8), (c >> 24) & BITMASK(8)
+-              #else
+-                      (c >> 24) & BITMASK(8), (c >> 18) & BITMASK(8),
+-                      (c >> 8) & BITMASK(8), (c >> 0) & BITMASK(8)
+-              #endif
+               };
+               
+               size_t delta = 0;
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644 (file)
index 0000000..703b2c9
--- /dev/null
@@ -0,0 +1 @@
+fix-big-endian-build.diff
index 3bc514fbc295a91034a55badc5f92269c1ad18f6..9ff5c79f0efb76b0de778ae1068dfc7ca0cc8d75 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/make -f
 %:
-       dh  $@
+       dh  $@ --with quilt
 
 override_dh_auto_configure:
        dh_auto_configure -- -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DENABLE_GETTEXT:BOOL=ON